<!--
 * @Description: 动画
 * @Author: rendc
 * @Date: 2025-09-19 11:31:56
 * @LastEditors: rendc
 * @LastEditTime: 2025-09-22 11:12:36
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>动画</title>
  <style>
    .ball {
      width: 100px;
      height: 100px;
      border-radius: 50%;
      display: inline-block;
      background-color: skyblue;
      animation: fk_ball 2s ease-out 0s infinite forwards;
      /* animation: name duration timing-function delay iteration-count direction fill-mode; */
    }

    @keyframes fk_ball {
      100% {
        margin-left: 100%;
      }
    }

    .wukong {
      /* border: 1px solid red; */
      width: 200px;
      height: 180px;
      overflow: hidden;
    }

    .wukong>img {
      /* border: 1px solid red; */
      width: 1600px;
      height: 180px;
      /* 执行的动画名称 */
      animation-name: kf_wukong;
      /* 执行的一轮用时 */
      animation-duration: 2s;
      /* 执行的次数 */
      animation-iteration-count: infinite;
      /* 控制出现的方式 */
      animation-timing-function: steps(8);
    }

    #ts,
    .ts {
      height: 240px;
    }

    /* 声明一个动画 */
    @keyframes kf_wukong {
      from {
        margin-left: 0px;
      }

      to {
        margin-left: -1600px;
      }
    }

    .tangs1 {
      /* border: 1px solid red; */
      width: 180px;
      height: 240px;
      background-image: url(../day10/img/ts.png);
      background-repeat: no-repeat;
      background-size: 1600px 240px;
      /* 执行的动画名称 */
      animation-name: kf_tangs;
      /* 执行的一轮用时 */
      animation-duration: 1s;
      /* 执行的次数 */
      animation-iteration-count: infinite;
      /* 控制出现的方式 */
      animation-timing-function: steps(8);
    }

    .tangs {
      /* border: 1px solid red; */
      width: 200px;
      /* width: 1600px; */
      height: 240px;
      background-image: url(../day10/img/ts.png);
      background-size: 1600px 240px;
      background-repeat: no-repeat;
      /* 模拟动画 */
      /* margin-left: -1000px; */
      /* 动画 */
      animation-name: kf_tangs;
      /* 执行的一轮用时 */
      animation-duration: 2s;
      /* 执行的次数 */
      animation-iteration-count: infinite;
      /* 控制出现的方式 */
      animation-timing-function: steps(8);
      /* 旋转 */
      /* transform: rotate(25deg); */
      /* 修改旋转轴 X Y 默认是Z */
      transform: rotateZ(25deg);
      /* 平移 */
      /* transform: translate(100px, -200px); */
      /* 缩放 */
      /* transform: scale(0.5); */
      /* transform: scale(1.5); */
      /* transform: scale(2, 0.5); */
      /* 速写 */
      /* transform: rotate(25deg) translate(100px, -200px) scale(0.5); */

    }

    /* 声明一个动画 */
    @keyframes kf_tangs {
      from {
        background-position: 0px;
      }

      to {
        background-position: -1600px;
      }
    }
  </style>
</head>

<body>
  <div class="ball">
  </div>
  <!-- 悟空 -->
  <div class="wukong">
    <img src="../day10/img/wk.png">
  </div>
  <!-- 唐僧 -->
  <div class="wukong ts">
    <img id="ts" src="../day10/img/ts.png">
  </div>
  <div class="tangs" style="display: none;">
  </div>
  <!-- <input type="number"> -->
</body>

</html>